package com.example.controller;

import com.example.dto.EmpLoginDto;
import com.example.pojo.Emp;
import com.example.pojo.MyResponseResult;
import com.example.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EmpLoginController {

    @Autowired
    private EmpService empService;

/*   @PostMapping("/login")
    public MyResponseResult<String> login(@RequestBody Emp emp){
       Emp e=empService.login(emp);
       return e!=null?MyResponseResult.ok(null):MyResponseResult.error("错误");

    }*/

    @PostMapping("/login")
    public MyResponseResult<String> login(@RequestBody EmpLoginDto dto){
        return empService.login(dto);
}
}
